package com.zl.tby.vo;

import com.zl.tby.model.TbyCameraInfo;
import com.zl.tby.model.TbyChangeTrend;
import lombok.Data;
import org.noear.solon.validation.annotation.Length;
import org.noear.solon.validation.annotation.NotBlank;

import java.math.BigDecimal;

/**
 * 物种变化趋势
 * @author sunjiaxing
 * @version 1.0
 * @since 2024/8/12 23:55
 */
@Data
public class TbyChangeTrendForm {
    /**主键id*/
    private Long id;
    /**种类*/
    @NotBlank(message = "种类不能为空")
    private String speciesCode;
    /**统计时间*/
    @NotBlank(message = "统计时间不能为空")
    private String statisticalTime;
    /**统计数量*/
    @NotBlank(message = "统计数量不能为空")
    @Length(max = 10, message = "统计数量最大长度为10")
    private String statisticalNum;

    public TbyChangeTrend createEntity() {
        TbyChangeTrend entity = new TbyChangeTrend();
        entity.setSpeciesCode(Long.valueOf(this.getSpeciesCode()));
        entity.setStatisticalTime(this.getStatisticalTime());
        entity.setStatisticalNum(new BigDecimal(this.getStatisticalNum()));
        return entity;
    }

    public void updateEntity(TbyChangeTrend entity) {
        entity.setSpeciesCode(Long.valueOf(this.getSpeciesCode()));
        entity.setStatisticalTime(this.getStatisticalTime());
        entity.setStatisticalNum(new BigDecimal(this.getStatisticalNum()));
    }
}
